package boot.service.impl;

import boot.entity.Book;
import boot.mapper.BookMapper;
import boot.service.IBookService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author HLF
 * @since 2022-04-11
 */
@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements IBookService {

    @Resource
    private BookMapper bookMapper;

    @Override
    @Transactional //开启事务
    public int insertBook(Book book) {
        return bookMapper.insertBook(book);
    }
}
